<template>
  <div>
    <Toolbar />
    <TypeNav />
    <!-- sections -->
    <section>
      <h1>✅ 商品加入购物车成功！！！</h1>
      <div class="goodInfo">
        <img :src="skuInfo.skuDefaultImg" alt="" />
        <div>
          <h2>产品名字：{{ skuInfo.skuName }}</h2>
          <h2>产品详情：{{ skuInfo.skuDesc }}</h2>
          <h2>产品数量：{{ $route.query.skuNum }}</h2>
        </div>
      </div>

      <hr />
      <br />
      <div class="goodBot">
        <router-link :to="`/detail/${skuInfo.id}`" class="linkbtn">查看商品详情</router-link>
        <router-link to="/shopcart" class="linkbtn">去购物车结算 ></router-link>
      </div>
    </section>

    <!-- 底部 -->
    <Footer></Footer>
  </div>
</template>
<script>
export default {
  name: 'AddCartSuccess',
  computed: {
    skuInfo() {
      return JSON.parse(sessionStorage.getItem('skuInfo'))
    },
  },
}
</script>
<style scoped>
section {
  width: 1200px;
  margin: 40px auto;
}
section h1 {
  margin: 15px 0 40px 0;
  color: #bc1616;
}
.goodInfo {
  display: flex;
  justify-content: left;
  align-items: center;
  margin-bottom: 40px;
}
.goodInfo h2 {
  margin: 0 20px;
}
img {
  width: 100px;
  height: 100px;
  border: 1px solid #cccccc;
}
.goodBot {
  display: flex;
  justify-content: flex-end;
}
.goodBot .linkbtn {
  height: 45px;
  line-height: 45px;
  padding: 0 30px;
  font-size: 14px;
  margin: 0 20px;
  background: #eeeeee;
  border: 0;
  cursor: pointer;
}
</style>
